package com.fare.taluo.core.domain.crawl;

import java.io.File;
import java.sql.Blob;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.dayatang.domain.InstanceFactory;
import com.fare.taluo.base.ddd.domain.baseentity.BaseEntity;

/**
 * 适配器文件
 */
@SuppressWarnings("serial")
@javax.persistence.Entity
@Table(name = "FDC_TASK_ADAPTER_UPLOADED")
public class AdapterUploadedEntity extends BaseEntity{

	@Column(name = "ADAPTER_DATA")
	private Blob adapterData;
	
	@Column(name = "CLASS_NAME")
	private String className;
	@Column(name = "CLASS_SIZE")
	private Long  classSize;
	
	@Transient
	private File file;
	
	public File getFile() {
		return file;
	}
	public void setFile(File file) {
		this.file = file;
	}

	public String getClassName() {
		return className;
	}
	public Blob getAdapterData() {
		return adapterData;
	}
	public void setAdapterData(Blob adapterData) {
		this.adapterData = adapterData;
	}
	public void setClassName(String className) {
		this.className = className;
	}
	
	public Long getClassSize() {
		return classSize;
	}
	public void setClassSize(Long classSize) {
		this.classSize = classSize;
	}

	private static AdapterUploadedEntityRepository getAdapterUploadedEntityRepository(){
		return InstanceFactory.getInstance(AdapterUploadedEntityRepository.class);
	}

	public Long SaveAdapterUploadedEntity(AdapterUploadedEntity aue) throws Exception{
		return getAdapterUploadedEntityRepository().SaveAdapterUploadedEntity(aue);
	}
	public void removeS(){
		getAdapterUploadedEntityRepository().removeS(this);
	}
}